﻿#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include <math.h>

int get_num_count(int n)
{
	int count = 1;
	while (n / 10)
	{
		count++;
		n /= 10;
	}
	return count;
}
int main19()
{
	int n = 0;
	scanf("%d", &n);
	int ret = get_num_count(n);
	int sum = 0;
	int num = n;
	while (num)
	{
		sum += pow((num % 10), ret);
		num /= 10;
	}
	if (sum == n)
		printf("1\n");
	else
		printf("0");
	return 0;
}

int main9()
{
	int i = 0;
	int flag = 1;
	double sum = 0;
	for (i = 1; i <= 100; i++)
	{
		sum += 1.0 / (i * flag);
		flag *= -1;

	}
	printf("%.2lf", sum);
	return 0;
}
int main8()
{
	int n = 0;
	int m = 0;
	scanf("%d %d", &n, &m);
	int max = n > m ? n : m;
	int i = 0;
	for (i = 1; i < 100; i++)
	{
		if ((m * i) % n == 0)
		{
			printf("%d\n", m * i);
			break;
		}
	}
	return 0;
}

//
void swap(int* e1, int* e2)
{
	int tmp = *e1;
	*e1 = *e2;
	*e2 = tmp;
}
int main7()
{
	int arr[10] = { 0};
	int j = 1;
	int i = 0;
	for (i = 0; i < 10; i++)
	{
		scanf("%d", &arr[i]);
	}
	while (j--)
	{
		for (i = 0; i < 9; i++)
		{
			if (arr[i] > arr[i + 1])
			{
				swap(&arr[i], &arr[i + 1]);
			}
		}
	}
	j = 1;
	while (j--)
	{
		for (i = 9; i > 0; i--)
		{
			if (arr[i] < arr[i - 1])
			{
				swap(&arr[i], &arr[i - 1]);
			}
		}
	}
	for (i = 0; i < 10; i++)
	{
		printf("%d ", arr[i]);
	}
	return 0;
}
int main5()
{
	char* arr[] = { 0,"eleven", "twelve", "thireteen", "forteen", "fiveteen",
					"sixteen", "seventeen", "eighteen", "nineteen" };
	char* arr1[] = { 0, "one", "tow", "three", "four", "five",
						"six", "seven", "eight", "nine" };
	char* arr2[] = { 0, "ten", "twenty", "thirty", "forty", "fivety",
					"sixty", "seventy", "eighty", "ninety"};
	int n = 0;
	scanf("%d", &n);
	if (n % 10 == 0)
	{
		printf("%s\n", arr2[n / 10]);
	}
	else if (n >= 11 && n <= 19)
	{
		printf("%s\n", arr[n % 10]);
	}
	else
	{
		printf("%s-%s\n", arr2[n / 10], arr1[n % 10]);
	}
	return 0;
}
//最大公约数
int main3()
{
	int a = 0;
	int b = 0;
	scanf("%d %d", &a, &b);
	int c = 0;
	while (a%b)
	{
		c = a % b;
		a = b;
		b = c;
	}
	printf("%d\n", b);
	return 0;
}



int main1()
{
	//定义三个边长
	int a = 0;
	int b = 0;
	int c = 0;
	//输入
	scanf("%d %d %d", &a, &b, &c);
	//输出
	//三角形两边之和大于第三边,两边之差小于第三边
	if (a < 0 || b < 0 || c < 0)
	{
		printf("输入无效边长\n");
	}
	else if (a + b > c && a + c > b && b + c > a)
	{
		if (a == b && b == c)
		{
			printf("等边三角形\n");
		}
		else if (a == b || b == c || a == c)
		{
			printf("等腰三角形\n");
		}
		else
		{
			printf("普通三角形\n");
		}
	}
	else
	{
		printf("非三角形\n");
	}
	return 0;
}
//99乘法表
int main6()
{
	int i = 0;
	int j = 0;
	for (i = 1; i <= 9; i++)
	{
		for (j = 1; j <=i; j++)
		{
			printf("%d*%2d=%2d ", j, i, j * i);
		}
		printf("\n");
	}
	return 0;
}
//判断三⻆形
int main1()
{
	//定义三个边长
	int a = 0;
	int b = 0;
	int c = 0;
	//输入
	scanf("%d %d %d", &a, &b, &c);
	//输出
	//三角形两边之和大于第三边,两边之差小于第三边
	if (a < 0 || b < 0 || c < 0)
	{
		printf("输入无效边长\n");
	}
	else if (((a + b > c) + (a + c > b) + (b + c > a)) == 3 && ((a - b < c) + (b - c < a) + (a - c < b)) == 3)
	{
		if (a == b && b == c)
		{
			printf("等边三角形\n");
		}
		else if ( a == c || a == b || b == c)
		{
			printf("等腰三角形\n");
		}
		else
		{
			printf("普通三角形\n");
		}
	}
	else
	{
		printf("非三角形\n");
	}
	return 0;
}






//
////枚举常量
//enum week
//{
//	//默认从0开始,依次加一
//	Mon = 1,
//	Tues,
//	Wes,
//	Thr,
//	Fri,
//	Sat,
//	Sun
//};
//
//
//int main1()
//{
//	printf("%d\n", Mon);
//	printf("%d\n", Tues);
//	printf("%d\n", Wes);
//	printf("%d\n", Thr);
//	printf("%d\n", Fri);
//	printf("%d\n", Sat);
//	printf("%d\n", Sun);
//	return 0;
//}





































/*
//优化版本
int main2()
{

	int num = 0;
	//输入一个三位数
	scanf("%d", &num);
	//存储结果
	int t = 0;
	while (num)
	{
		t = t * 10 + num % 10;
		num /= 10;
	}
	printf("%d\n", t);
	return 0;
}

int main1()
{
	int num = 0;
	scanf("%d", &num);
	int t = 0;
	int j = 0;
	for (j = 100; j >= 1; j /= 10)
	{
		t += num % 10 * j;
		num /= 10;
	}
	printf("%d\n", t);
	return 0;
}

int main3()
{
	//int a = 12345;
	//char* a = "abcdef";
	//printf("%4s\n", a);
	//printf("%4d\n", a);
	float a = -123456;
	printf("%-10f\n", a);
	return 0;
}


int Binary_search(int* arr, int len, int k)
{
	//数组左边元素的下标
	int left = 0;
	//数组右边元素的下标
	int right = len - 1;
	int mid = 0;
	while (left <= right)
	{
		//中间元素下标
		mid = (left + right) / 2;
		if (arr[mid] < k)
		{
			left = mid + 1;
		}
		else if (arr[mid] > k)
		{
			right = mid - 1;
		}
		else
		{
			return mid;
		}
	}
	return -1;
}
int main4()
{
	int arr[10] = { 1,2,3,4,5,6,7,8,9,10 };
	int len = sizeof(arr) / sizeof(arr[0]);

	int k = 0;
	scanf("%d", &k);
	int ret = Binary_search(arr, len, k);
	if (ret < 0)
	{
		printf("找不到\n");
	}
	else
	{
		printf("找到了,下标为%d\n", ret);
	}
	return 0;
}

*/